"""
该文件用于 主页界面
"""
import time
from utils.utils_log import loggerCase
from page.base_page import BasePage
from common_ai_img import AIButton, Icon, OcrText

class MainPage(BasePage):
    """网格页面"""

    # 去后处理
    __to_post_processing = AIButton(OcrText("Post-Processing"))

    # 去测量
    __to_inspect = AIButton(OcrText("Inspect"))

    # 新建工程
    __new_project_group = AIButton(OcrText("New Project Group"))

    # 导入工程
    __open_project_group = AIButton(OcrText("Open Project Group"))

    # 回主页
    __homeIcon = AIButton(Icon("homeIcon"))


    def click_to_post_processing(self, max_wait_time=3):
        """去后处理"""
        loggerCase.info("去后处理")
        self.click(self.__to_post_processing, max_wait_time=max_wait_time)

    def click_to_inspect(self, max_wait_time=3):
        """去检测"""
        loggerCase.info("去检测")
        self.click(self.__to_inspect, max_wait_time=max_wait_time)

    def click_new_project_group(self, max_wait_time=3):
        """新建工程"""
        loggerCase.info("新建工程")
        self.click(self.__new_project_group, max_wait_time=max_wait_time)

    def click_open_project_group(self, max_wait_time=3):
        """打开工程"""
        loggerCase.info("打开工程")
        self.click(self.__open_project_group, max_wait_time=max_wait_time)

    def click_homeIcon(self, max_wait_time=3):
        """回主页"""
        loggerCase.info("回主页")
        self.click(self.__homeIcon, max_wait_time=max_wait_time)


if __name__ == '__main__':
    MainPage().click_homeIcon()
